clear

*Change WD:
cd "/Users/patrickhulme/Dropbox/Replicate/War_and_Responsibility/Output"

import excel "Multivariate_DF", firstrow case(lower)

generate congressional_support_score =  avg_agg_support_pre_use_of_force

***Alternatively, use the GPT estimates:
*generate congressional_support_score = gpt_support_pre_use_of_force_onl


eststo clear
***Table A8***
preserve

eststo: oprobit us_high_act   c.congressional_support_score  c.effcaprat yrtrig average_polar_btwn_chambers_d1 net_approval unrate cold_war distance_usa ongoing_war continuing_war, vce(robust)
estat ic 

eststo: oprobit us_high_act   c.congressional_support_score  c.effcaprat yrtrig average_polar_btwn_chambers_d1 net_approval unrate cold_war distance_usa ongoing_war continuing_war theta2_mean prez_party ym_hsm, vce(robust)
estat ic 

eststo: oprobit us_high_act   c.effcaprat yrtrig prez_copartisans average_polar_btwn_chambers_d1 net_approval unrate cold_war distance_usa ongoing_war continuing_war, vce(robust)
estat ic  

eststo: oprobit us_high_act   c.effcaprat yrtrig prez_copartisans average_polar_btwn_chambers_d1 net_approval unrate cold_war distance_usa ongoing_war continuing_war theta2_mean prez_party ym_hsm, vce(robust)
estat ic  

eststo: oprobit us_high_act  c.effcaprat yrtrig average_polar_btwn_chambers_d1 net_approval percent_repubmean unrate cold_war distance_usa ongoing_war continuing_war, vce(robust)
estat ic 

eststo: oprobit us_high_act   c.effcaprat yrtrig average_polar_btwn_chambers_d1 net_approval percent_repubmean unrate cold_war distance_usa ongoing_war continuing_war theta2_mean prez_party ym_hsm, vce(robust)
estat ic 

eststo: oprobit us_high_act    c.congressional_support_score c.effcaprat yrtrig prez_copartisans average_polar_btwn_chambers_d1 net_approval percent_repubmean unrate cold_war distance_usa ongoing_war continuing_war, vce(robust)
estat ic 

eststo: oprobit us_high_act    c.congressional_support_score c.effcaprat yrtrig prez_copartisans average_polar_btwn_chambers_d1 net_approval percent_repubmean unrate cold_war distance_usa ongoing_war continuing_war theta2_mean prez_party ym_hsm, vce(robust)
estat ic 


esttab using Table_A8_Escalation_Level_Ordered_Probit.tex, ///
    stats(N aic bic, fmt(%9.0f %9.2f %9.2f)) replace b(3) se(3) lines ///
    star(* .05 ** .01 *** .001) nocon compress ///
    keep(congressional_support_score prez_copartisans percent_repubmean effcaprat yrtrig ///
         average_polar_btwn_chambers_d1 net_approval unrate cold_war distance_usa ///
         ongoing_war continuing_war theta2_mean prez_party ym_hsm) ///
    order(congressional_support_score prez_copartisans percent_repubmean effcaprat yrtrig ///
          average_polar_btwn_chambers_d1 net_approval unrate cold_war distance_usa ///
          ongoing_war continuing_war theta2_mean prez_party ym_hsm) ///
    varlabels(congressional_support_score "Informal Cong. Sentiment" ///
              prez_copartisans "\% Copartisans" ///
              percent_repubmean "\% Republicans" ///
              effcaprat "Power Ratio" ///
              yrtrig "Year" ///
              average_polar_btwn_chambers_d1 "Polarization" ///
              net_approval "Pres. Approval" ///
              unrate "Unemployment Rate" ///
              cold_war "Cold War" ///
              distance_usa "Distance" ///
              ongoing_war "Ongoing War" ///
              continuing_war "Continuing War" ///
              theta2_mean "Leader Willingness to Use Force" ///
              prez_party "Pres. Party" ///
              ym_hsm "High Self-Monitor") ///
			    nodepvars 
eststo clear

restore





***Table A9***
preserve

eststo clear

eststo: reg us_high_act   c.congressional_support_score  c.effcaprat yrtrig average_polar_btwn_chambers_d1 net_approval unrate cold_war distance_usa ongoing_war continuing_war, vce(robust)
estat ic 

eststo: reg us_high_act   c.congressional_support_score  c.effcaprat yrtrig average_polar_btwn_chambers_d1 net_approval unrate cold_war distance_usa ongoing_war continuing_war theta2_mean prez_party ym_hsm, vce(robust)
estat ic 

eststo: reg us_high_act   c.effcaprat yrtrig prez_copartisans average_polar_btwn_chambers_d1 net_approval unrate cold_war distance_usa ongoing_war continuing_war, vce(robust)
estat ic  

eststo: reg us_high_act   c.effcaprat yrtrig prez_copartisans average_polar_btwn_chambers_d1 net_approval unrate cold_war distance_usa ongoing_war continuing_war theta2_mean prez_party ym_hsm, vce(robust)
estat ic  

eststo: reg us_high_act  c.effcaprat yrtrig average_polar_btwn_chambers_d1 net_approval percent_repubmean unrate cold_war distance_usa ongoing_war continuing_war, vce(robust)
estat ic 

eststo: reg us_high_act   c.effcaprat yrtrig average_polar_btwn_chambers_d1 net_approval percent_repubmean unrate cold_war distance_usa ongoing_war continuing_war theta2_mean prez_party ym_hsm, vce(robust)
estat ic 

eststo: reg us_high_act    c.congressional_support_score c.effcaprat yrtrig prez_copartisans average_polar_btwn_chambers_d1 net_approval percent_repubmean unrate cold_war distance_usa ongoing_war continuing_war, vce(robust)
estat ic 

eststo: reg us_high_act    c.congressional_support_score c.effcaprat yrtrig prez_copartisans average_polar_btwn_chambers_d1 net_approval percent_repubmean unrate cold_war distance_usa ongoing_war continuing_war theta2_mean prez_party ym_hsm, vce(robust)
estat ic 

esttab using Table_A9_Escalation_Level_OLS.tex, ///
    stats(N aic bic, fmt(%9.0f %9.2f %9.2f)) replace b(3) se(3) lines ///
    star(* .05 ** .01 *** .001) nocon compress ///
    keep(congressional_support_score prez_copartisans percent_repubmean effcaprat yrtrig ///
         average_polar_btwn_chambers_d1 net_approval unrate cold_war distance_usa ///
         ongoing_war continuing_war theta2_mean prez_party ym_hsm) ///
    order(congressional_support_score prez_copartisans percent_repubmean effcaprat yrtrig ///
          average_polar_btwn_chambers_d1 net_approval unrate cold_war distance_usa ///
          ongoing_war continuing_war theta2_mean prez_party ym_hsm) ///
    varlabels(congressional_support_score "Informal Cong. Sentiment" ///
              prez_copartisans "\% Copartisans" ///
              percent_repubmean "\% Republicans" ///
              effcaprat "Power Ratio" ///
              yrtrig "Year" ///
              average_polar_btwn_chambers_d1 "Polarization" ///
              net_approval "Pres. Approval" ///
              unrate "Unemployment Rate" ///
              cold_war "Cold War" ///
              distance_usa "Distance" ///
              ongoing_war "Ongoing War" ///
              continuing_war "Continuing War" ///
              theta2_mean "Leader Willingness to Use Force" ///
              prez_party "Pres. Party" ///
              ym_hsm "High Self-Monitor") ///
			    nodepvars 
eststo clear



restore








***Figure A10***
****Make it so victory = 1, defeat = -1, 0 = draw
replace trinary=1 if trinary==1
replace trinary=0 if trinary==2
replace trinary=-1 if trinary==3


gen force_employed =.

replace force_employed=1 if us_high_act > 6
replace force_employed=0 if us_high_act < 7


gen WinWoFighting = 0

replace WinWoFighting = 1 if trinary > 0 & force_employed==0 

gen rug =-0
gen pipe = "|"



****marginal effects plots


grstyle clear
set scheme s2color
grstyle init
grstyle set plain, box
grstyle color background white
grstyle set color Set1
grstyle yesno draw_major_hgrid yes
grstyle yesno draw_major_ygrid yes
grstyle color major_grid gs8
grstyle linepattern major_grid dot
grstyle set legend 4, box inside
grstyle color ci_area gs12%50

graph set window fontface "Times New Roman"

preserve

drop if WinWoFighting == 1

eststo: reg us_high_act c.congressional_support_score c.effcaprat yrtrig prez_copartisans percent_repubmean average_polar_btwn_chambers_d1 net_approval unrate  continuing_war  theta2_mean prez_party ym_hsm cold_war distance_usa ongoing_war, vce(robust)

replace rug =2

margins, at(congressional_support_score=(-0.5 -0.4 -0.3 -0.2 -0.1 0 0.1 0.2 0.3 0.4 0.5) )
replace rug =2
marginsplot,  ylabel(0(1)9) ylabel(1 "No Response" 2 "Economic" 3 "Threat" 4 "Show of Force" 5 "Military Advisers" 6 "Uncontested Mil Act" 7 "0" 8 "1-5" 9"6-25" 10 "26-50" 11 "51-100" 12 "101-250" 13 "251-500" 14 "501-999" 15 "1000+", ang(360)) recast(line) plotopts(lcolor(gs4*0.7)) recastci(rline) ciopts(lpattern(dash) lcolor(gs4*0.7))   title("") xtitle("Congressional Support Score", size(large)) ytitle("Predicted Use of Force Level" "(Combat Deaths)", size(large)) legend(off)
 graph export "Fig_A_11_Pred_esc_level_no_win_wo_fighting.pdf",replace
 
 restore
 

  
  
  






















